package com.hollycrm.ahunicom.sheet.business.hibernate;
import java.util.List;
import org.springframework.orm.hibernate.support.HibernateDaoSupport;

import com.hollycrm.ahunicom.sheet.AhConstants;
import com.hollycrm.ahunicom.sheet.business.SheetAjaxLogic;
import com.hollycrm.unicom.sheet.domain.DealSheet;

public class HibernateSheetAjaxLogic extends HibernateDaoSupport implements SheetAjaxLogic {

	public String query112FlowNO(String dealSheetFlowNO) {
		String flowNo_112="-1";
		String hql = "from dealSheet in " + DealSheet.class + " where dealSheet.sheetFlowNO='" +
						dealSheetFlowNO +"' and dealSheet.categoryID='" + AhConstants.SHEET_CATEGORYID_GG  + "'" ;
//		System.out.println("-----hql="+hql); 
		try{
			List dealSheets = this.getHibernateTemplate().find(hql);
			if(dealSheets!=null && dealSheets.size()>0){
				DealSheet dealSheet = (DealSheet)dealSheets.get(0);
				flowNo_112 = dealSheet.getSpareContentField2();
			}
			return flowNo_112;
		}catch(Exception e){
			e.printStackTrace();
			return "-1";
		}
	}

}
